#include <QApplication>
#include <QQmlApplicationEngine>
#include <QGuiApplication>
#include "core/file/ini/UserSettings.h"


int main(int argc, char *argv[])
{
    QCoreApplication::setOrganizationName("HUAPI");
    QCoreApplication::setApplicationName("HUAPI_QtQuick");
    QGuiApplication app(argc, argv);

    QQmlApplicationEngine engine;

    QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,
            &app, []() { QCoreApplication::exit(-1); },
            Qt::QueuedConnection);
    
    engine.load(QStringLiteral("qrc:/HUAPI_QtQuick/qml/App.qml"));

    UserSettings* settings = new UserSettings(qApp->applicationDirPath() + "/Settings/user.ini", QSettings::IniFormat, qApp);

    return app.exec();
}
